Next | Prev | Up | Top | Contents | Index

Standard Device Drivers

The simplest migration is for standard (non-network and non-STREAMS) device drivers. Generally, these drivers require only recompilation, and do not require source changes. If these drivers check for root to protect privileged operations, however, the Trusted IRIX capabilities mechanism requires changes similar to the following fragment:

Note: If Trusted IRIX is not installed, these map to a stub that does a simple u.u_uid == 0 check.

*** 30,35 ****
--- 30,36 ----
  #include "sys/pio.h"
  #include "sys/strsubr.h"
  #include "sys/ddi.h"
+ #include "sys/capability.h"
  
  extern time_t lbolt;
  
*** 1447,1453 ****
     * reasons.*/
    if (((cdp->cd_cflag & CLOCAL) ^ (cflag & CLOCAL)) &&
!       !suser()) {
            u.u_error = 0;  /* XXXrs */
            cflag &= ~CLOCAL;
            cflag |= cdp->cd_cflag & CLOCAL;
--- 1448,1454 ----
     * reasons.*/
    if (((cdp->cd_cflag & CLOCAL) ^ (cflag & CLOCAL)) &&
!       !_CAP_ABLE(CAP_DEVICE_MGT)) {
            u.u_error = 0;  /* XXXrs */
            cflag &= ~CLOCAL;
            cflag |= cdp->cd_cflag & CLOCAL;
Refer to the file sys/capability.h for a list of all capabilities.


Next | Prev | Up | Top | Contents | Index